package com.example.administrator.leargit.service;

import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.util.Log;

import com.example.administrator.leargit.R;
import com.example.administrator.leargit.activity.MainActivity;

/**
 * Created by Administrator on 2016/12/22 0022.
 */
public class MyService extends IntentService {
    public MyService() {
        super("MyService");
    }

    @Override
    public void onCreate() {
        super.onCreate();
        NotificationManager manager= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        Notification notification=new Notification(R.mipmap.ic_launcher,"Notifaction comes",System.currentTimeMillis());
        Intent notificationIntent =new Intent(this, MainActivity.class);
        PendingIntent pendingIntent=PendingIntent.getActivity(this,0, notificationIntent,0);

    }

    @Override
    protected void onHandleIntent(Intent intent) {
        Log.d("MyService","Thread id is"+Thread.currentThread());

    }
}
